<template>
  <div class="d-flex flex-column w-100">
    <div class="header d-flex flex-row w-100 border-bottom">
      <ul class="d-flex w-100 justify-content-center">
        <li :class="index == 1 ? 'active' : ''" @click="changeNav(1, 'Yzm')">
          验证码
        </li>
        <li
          :class="index == 2 ? 'active' : ''"
          @click="changeNav(2, 'CompLoginmima')"
        >
          账号密码
        </li>
      </ul>
    </div>
    <div class="body d-flex flex-column">
      <component :is="comp"></component>
    </div>
  </div>
</template>

<script>
import Yzm from "@/components/comp-loginyzm.vue";
import CompLoginmima from "../components/comp-loginmima.vue";
export default {
  components: {
    Yzm,
    CompLoginmima,
  },
  data() {
    return {
      comp: Yzm,
      index: 1,
    };
  },
  methods: {
    changeNav(i, name) {
      this.index = i;
      this.comp = name;
    },
  },
};
</script>

<style lang="less" scoped>
@import "../assets/reset";
.header {
  width: 200px;
  height: 50px;
  background-color: #fff;
  ul {
    li {
      width: 200px;
      display: flex;
      padding: 10px 50px;
      color: #999;
    }
    .active {
      font-weight: bold;
      color: #000;
      border-bottom: 2px solid #000;
    }
  }
}
</style>